package com.company.myfirstjmixproject.entity.enums;

import io.jmix.core.metamodel.datatype.impl.EnumClass;

import javax.annotation.Nullable;


public enum ComponentUomEnum implements EnumClass<String> {

    T("T"),
    KG("Kg"),
    L("L");

    private String id;

    ComponentUomEnum(String id) {
        this.id = id;
    }

    public String getId() {
        return id;
    }

    @Nullable
    public static ComponentUomEnum fromId(String id) {
        for (ComponentUomEnum at : ComponentUomEnum.values()) {
            if (at.getId().equals(id)) {
                return at;
            }
        }
        return null;
    }
}